<?php
/**
 * The user controller of the users module.
 *
 * @author Flavius Aspra <flavius.as@gmail.com>
 * @link http://yii-modules.yet-another-project.com
 * @copyright 2010 &copy; Flavius Aspra
 * @licence http://yii-modules.yet-another-project.com/license/
 * @package users
 * @version $Id: UserController.php 50 2010-05-01 12:10:33Z flavius.as $
 */
class UserController extends Controller {
	public function actionLogin() {
		$model = new LoginForm;
		$form = new CForm('users.views.user.loginForm',$model);
		if($form->submitted('login')) {
			$model->attributes = $_POST['LoginForm'];
			if($model->validate()) {
				$this->redirect(Yii::app()->user->returnUrl);
			}
		}
		$this->render('login',array('form' => $form));
	}
	public function actionLogout() {
		Yii::app()->user->logout();
		$this->redirect(Yii::app()->user->returnUrl);
	}
}
